/**
 * author:wos
 * time:2024-1-4
 * title:获取服务端验证码（主要用于koa环境测试)
 */
const os = require('os')
async function version(ctx, next) {
    global.response(ctx, {
        "status":200,
        "code": 200,
        "data": {
            "cpu":{
                "cpus":os.cpus(),
                title:os.cpus()[0].model,
                cpuCores:os.cpus().length,
                arch:os.arch(),
            },
            "menm":{
                totalmem:os.totalmem(),
                freemem:os.freemem(),
                nodeVersion:process.version
            },
            "server":{
                hostname:os.hostname(),
                platform:os.platform(),
                release:os.release(),
            },
            // "disk":{
            //     total:  diskInfo.total,
            //     used:   diskInfo.used,
            //     free:   diskInfo.free,
            // }
        },
        "msg":'success'
    })
}
module.exports = version


